<template>
	<view class="container">
		<navbar title="学习中心" color="#333333">
			<view class="left-icon" slot="leftIcon" style="position: absolute;">
				<view class="logo">
					LOGO
				</view>
			</view>
		</navbar>
		<view class="content">
			<view class="tab">
				<view class="item">
					<text :class="tab_index==1 ? 'select' : ''" @click="tab_index=1">学习记录</text>
				</view>
				<view class="item">
					<text :class="tab_index==2 ? 'select' : ''" @click="tab_index=2">学习统计</text>
				</view>
			</view>
			
			<view class="list" v-if="tab_index==1">
				<view class="item"v-for="(item,i) in 5" :key="i">
					<goodsBox class="item"
						:style="{width: '100%'}" 
						:imageStyle="{width:'324rpx',height:'232rpx'}" 
						:styleType="2">
						<text slot="center">学习时长：200分钟</text>
						<view slot="priceBox" class="progress">
							<view class="bg">
								<view class="con" :style="{width:'20%'}"></view>
							</view>
							<text>20%</text>
						</view>
					</goodsBox>
				</view>
			</view>
			
			<view class="date-box">
				<view class="box-1">
					<view class="title">
						<image :src="$img_path('/course/img/13.png')" mode="widthFix"></image>
						<text>累计数据</text>
						
					</view>
				</view>
			</view>
		</view>
		
		<tarbar index="3" page="2"></tarbar>
	</view>
</template>

<script>
	import goodsBox from '../../components/service-box/goods-box.vue';
	export default {
		components:{
			goodsBox
		},
		data() {
			return {
				tab_index:1
			};
		}
	}
</script>
<style></style>
<style lang="scss" scoped>
.container{
	.left-icon{
		left: 22rpx;
		width: 142rpx;
		height: 68rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0,0,0,0.04);
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.content{
		.tab{
			display: flex;
			align-items: center;
			justify-content: center;
			padding-top: 32rpx;
			.item{
				text{
					font-weight: 400;
					font-size: 32rpx;
					color: #333333;
					line-height: 44rpx;
					position: relative;
					&.select{
						font-weight: bold;
						color: #E72A2A;
						&::before{
							content: '';
							width: 52rpx;
							height: 8rpx;
							background: #E72A2A;
							border-radius: 4rpx 4rpx 4rpx 4rpx;
							position: absolute;
							top: calc(100% + 4rpx);
							left: 50%;
							transform: translateX(-50%);
						}
					}
					
				}
				
				&:nth-child(2){
					margin-left: 162rpx;
				}
			}
		}
		.list{
			margin-top: 48rpx;
			padding: 0 22rpx;
			box-sizing: border-box;
			.item{
				margin-top: 20rpx;
			}
			
			.progress{
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;
				.bg{
					width: calc(100% - 100rpx);
					height: 20rpx;
					border-radius: 10rpx;
					background: rgba(231,42,42,0.3);
					.con{
						height: 20rpx;
						border-radius: 10rpx;
						background: #E72A2A;
					}
				}
				text{
					font-weight: bold;
					font-size: 30rpx;
					color: #333333;
					line-height: 42rpx;
				}
			}
		}
	}
}
</style>
